package com.cyf.db.mapper.smartCity;

import com.cyf.db.bean.LocalDevice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 车场设备表
 * Created by hfy on 2017/7/22.
 */
@Mapper
public interface LocalDeviceMapper {


    @Select("select name from local_device where parkingId = #{parkingId} and localDeviceId = #{localDeviceId} limit 0, 1")
    String getNameByParkingIdAndLocalDeviceId(@Param("parkingId") int parkingId, @Param("localDeviceId") Integer localDeviceId);

    @Select("select localDeviceId, parkingId, name, deviceType " +
            "from local_device " +
            "where ifUse = 1 " +
            "and parkingId = #{parkingId} ")
    List<LocalDevice> listBaseInfoByParkingId(@Param("parkingId") int parkingId);

}
